beginoutdoorscript;

variables;
short bmessage;
string custom_m;

body;

beginstate 0;
break;

beginstate 1;
break;

beginstate START_STATE;
break;

beginstate 10;

	if(get_flag(8,0) >= 3){
		if(get_flag(3,0) < 2){
			message_dialog("This used to be protecting the western borders of Minnow Territory from the Georgsbruck Tribe.  Now, it's smoldering and its personnel have been murdered in cold blood.","You will not stand for such blatant mockeries of Imperial dominion.");
			set_flag(3,0,2);
		}
	}
	if(get_flag(3,0) == 0){
		message_dialog("This is the easternmost guardpost in Minnow Territory.  It's suffered a few attacks from the nearby Georgsbruck Tribe, but it's managed to hold its ground.","Unfortunately, there are no troops you can take with you; they're running with an absolute minimum in personnel as-is.");
		set_flag(3,0,1);
	}

break;

beginstate 11;

	if(get_flag(8,0) >= 3){
		if(get_flag(4,0) < 2){
			message_dialog("This guardpost used to be manned.  Now, it's been sacked.  It looks as if the defenders were attempting to flee back to Fort Minnow to warn the soldiers there, but they were surrounded and slain.","The goblins will pay.");
			set_flag(4,0,2);
		}
	}
	if(get_flag(4,0) == 0){
		message_dialog("This used to be the farmland for the Minnow Tribe before Imperial warriors were able to liberate it.  Now, it can be tended by human hands whenever the Minnow Tribe is defeated.","Currently, a minute guardtower has been erected, but merely as a lookout for incoming raiders.");
		set_flag(4,0,1);
	}

break;

beginstate 12;

	if(get_flag(5,0) == 0){
		message_dialog("A poor, adventurous soul decided at some point that tilling the ground here would be a good idea.  Unfortunately, the barbaric goblin raiders slew his dream and him with it.","");
		set_flag(5,0,1);
	}

break;

beginstate 13;

	if(get_flag(8,0) >= 3){
		message_dialog("This is the northern extent of the Empire's control of Minnow Territory.  Beyond here lies the other side of Mount Minnow, and a few raiders have been spotted in the area, justifying a small guard being posted here.","You warn the guards here that the Minnow Tribe has fled its village, and that at any sign of any unusual activity, they should flee.  They thank you for your warning and maintain their vigil.");
		block_entry(1);
		end();
	}
	message_dialog("This is the northern extent of the Empire's control of Minnow Territory.  Beyond here lies the other side of Mount Minnow, and a few raiders have been spotted in the area, justifying a small guard being posted here.","Given that this is not Imperial territory, it is beyond your jurisdiction.  You must stay south of this point.");
	block_entry(1);

break;

beginstate 14;

	if(get_flag(6,0) == 0){
		reset_dialog();
		add_dialog_str(0,"The small cadre of soldiers gathered from Fort Minnow are standing here, waiting for you.",0);
		add_dialog_str(1,"One of them walks up to you and says, _Greetings!  We've spotted a fair-sized group of goblins anticipating our attack at the top of the hill._",0);
		add_dialog_str(2,"_Still, we have the benefit of superior training and equipment.  We are ready to attack at your command!_",0);
		add_dialog_str(3,"You tell the soldiers to follow you up the mountain.  After giving a quick rallying cry, boosting your men's morale, you prepare to make your way up.",0);
		add_dialog_choice(0,"Let's go, men!");
		bmessage = run_dialog(1);
		set_flag(6,0,1);
	}

break;

beginstate 15;

	if(get_flag(8,0) >= 3){
		message_dialog("You know exactly what lies up this mountain-- nothing.  The goblins have already fled their village, to wreak havoc on more innocent civilians and brave soldiers.","");
		block_entry(1);
		end();
	}
	if(get_flag(6,0) >= 1){
		message_dialog("You are under strict orders to attack the Minnow Tribe, not to return to base.","");
		block_entry(1);
	}

break;

beginstate 16;

	if(get_flag(7,0) > 0)
		end();
	reset_dialog();
	add_dialog_str(0,"The goblins are waiting here, ready to charge.  Are you prepared to attack?",0);
	add_dialog_choice(0,"Charge!");
	add_dialog_choice(1,"Wait...");
	bmessage = run_dialog(0);
	if(bmessage == 2){
		block_entry(1);
		end();
	}
	message_dialog("The goblins have the advantage of a higher ground, but they should still be relatively easily slaughtered.  You order most of your men to hold their ground in case the goblins try to outmaneuver you-- your orders were, after all, to let none escape.","");
	set_char_status(1000,1,-15,0,0);
	create_out_spec_enc(0);
	set_flag(7,0,1);

break;

beginstate 17;

	message_dialog("Another proud victory for the Empire.","");

break;

beginstate 18;

	message_dialog("One of your men walks up to you and asks you why you let them get away.","You explain that they can only flee back to their village:  If you don't kill all of them here, then there's only one place you can kill them at later.  That's why you stationed some of your men in the rear, to block their escape.");

break;

beginstate 19;

	if(get_flag(8,0) < 3)
		block_entry(1);
	if(get_flag(8,0) == 3){
		message_dialog("There's a small crevasse in the mountainside here.  It's all too obvious from this perspective, but it's covered in foliage and boulders from the other end.","Did those rat bastards actually manage to disguise this passage, hiding it from Imperial patrols...?  They can't be THAT smart-- they must be lucky.");
		set_flag(8,0,4);
	}

break;

beginstate 20;

	message_dialog("To the east of here is Georgsbruck Territory, struggling with a goblin tribe of its own.  As tempting as it might be to go from one goblin-infested territory to another, it probably would not be wise to leave your post.","You know, that whole _court martial_ deal...");
	block_entry(1);

break;

beginstate 21;

	if(get_flag(8,0) == 4){
		if(get_flag(10,0) >= 10)
			message_dialog("You should probably head back to Fort Minnow...  you know...  after wasting all of your men in a futile attempt to slay a tribe that's now escaped and is probably wreaking havoc on the valley.","");
		if(get_flag(10,0) == 9)
			message_dialog("You tell your man-- the sole survivor of the fight, having squandered the others-- to follow you back to Fort Minnow.  He anxiously agrees, if only to have someone to protect him so he isn't wandering about alone.","");
		if(get_flag(10,0) < 9)
			message_dialog("You tell your men to follow you back to Fort Minnow.  They agree, but after being so badly humiliated, they aren't in very good spirits.","");
		set_flag(8,0,5);
	}

break;

beginstate 22;

	if(get_flag(8,0) == 5){
		reset_dialog();
		add_dialog_str(0,"The fort...  there's smoke coming from it!  The Minnow Tribe didn't just escape, they sacked Fort Minnow itself!  The sounds of feasting and merriment are audible, even from here.  While you were gone, the fort was lost.",0);
		add_dialog_str(1,"It's highly unlikely that you'd be able to retake the fort.  Sure, you took out a fair number of the goblins, but the joke is most certainly on you:  With inferior equipment and training, they managed to secure a treasure trove of resources.",0);
		add_dialog_str(2,"All you have to do now is to return to Junna Province and tell Brigadier General Francois that you managed to hand over a solidly-built hilltop fort and all of its resources to a bunch of primitives.  An unenviable task.",0);
		if(get_flag(10,0) == 9)
			add_dialog_str(3,"Your last remaining man, after collecting his senses, basically flips out and flees to the south.  You can't blame him-- his best bet for staying alive is finding an intact unit to join.",0);
		if(get_flag(10,0) < 9)
			add_dialog_str(3,"Your remaining men, after collecting their senses, basically flip out and flee to the south.  You can't blame them-- their best bet for staying alive is finding an intact unit to join.",0);
		add_dialog_choice(0,"...");
		bmessage = run_dialog(1);
		set_flag(8,0,6);
	}

break;

beginstate 23;

	if(get_flag(8,0) == 0){
		message_dialog("You shouldn't leave your post, especially given that you have a mission from the Brigadier General himself.","");
		block_entry(1);
		end();
	}
	if((get_flag(8,0) >= 1) && (get_flag(8,0) < 6)){
		message_dialog("You may have failed at your mission, but you should at least report back to Fort Minnow to begin the arduous task of chasing down the vermin wherever they've fled to.","");
		block_entry(1);
		end();
	}
	reset_dialog();
	add_dialog_str(0,"The road to Junna Province is long.  Perhaps it's a short march, but it seems to take forever, like a prisoner's last meal before execution or the fleeting few breaths of a man on his deathbed.",0);
	add_dialog_str(1,"Both such men, however, are enviable to you at this point-- at least they don't have to live to bear their burdens.  You, however, have one hell of a life awaiting you after a disastrous blunder like this.",0);
	add_dialog_str(2,"In the end, though, the Brigadier General is merciful.  You only end up breaking a few rib bones and a shin when he hears the news, and you're given the better part of a day to rest up before being sent to the front lines again.",0);
	add_dialog_str(3,"Your assignment is to serve under another, considerably more competent Captain-- this time with the rank of Private-- marching north from Terrence Province to retake Minnow Territory.",0);
	add_dialog_str(4,"The beatings given to you by your fellow Privates for wasting away a whole territory are considerably lenient, all things considered.  Given that it's your massive ineptitude that lost the territory in the first place.",0);
	if(party_size() == 1)
		add_dialog_str(5,"You moron.",0);
	if(party_size() > 1)
		add_dialog_str(5,"You morons.",0);
	add_dialog_choice(0,"...");
	bmessage = run_dialog(0);
	end_scenario(1);

break;

